package kafka;


import org.apache.flink.api.common.serialization.SimpleStringSchema;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import udf.MySqlSinkT2;

/**
 * Create by zhh on 2022/9/19.
 */
public class FlinkKafkaAPP {
    public static void main(String[] args) throws Exception {

        DataStream<String> stream = flinkUtils.createKafkaStreamV2(args,SimpleStringSchema.class);
        SingleOutputStreamOperator<Tuple2<String, Integer>> result = wcUtils.wordCount(stream);
        result.addSink(new MySqlSinkT2());
        flinkUtils.env.execute("FlinkKafkaAPP");

    }
}
